using System;

namespace Adge.UI.WebControls
{
	/// <summary>
	/// Summary description for CategoryRepeaterPage.
	/// </summary>
	public class CategoryRepeaterPage : System.Web.UI.Page
	{
		#region Protected Repeater Display Methods
		private int lastGroupID = -1;
		bool dispAltColor = false;
		protected string PickTRColor(int GroupID)
		{
			if (lastGroupID != GroupID)
			{
				lastGroupID = GroupID;
				dispAltColor = !dispAltColor;
			}

			if (dispAltColor)
				return "<tr bgcolor=\"white\">";
			else
				return "<tr bgcolor=\"yellow\">";
		}

		protected virtual string DisplayRadioButton(int categoryID, int selectedCategoryID)
		{
			string radButtonHTML = string.Concat("<input type=\"radio\" name=\"categoryAdd\" value=\"", categoryID, "\" ");
			if (categoryID == selectedCategoryID)
				radButtonHTML += "checked=\"checked\" ";

			return string.Concat(radButtonHTML, "/>");
		}
		#endregion
	}
}
